import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Layout from '../layout/index.vue';
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('../pages/home/index.vue')
      },
      {
        path: '/good/create',
        name: 'good-create',
        component: () => import('../pages/good/create/index.vue')
      },
      {
        path: '/good/list',
        name: 'good-list',
        component: () => import('../pages/good/list/index.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../pages/login/index.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../pages/about/index.vue')
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
